$(function(){
		var option="";
		$("select[name='betweenId']").html("");
		$.ajax({
			url:"DataTable/findRelationship",
			type:'POST',
			datatype:'JSON',
			success:function(res){
				option+="<option value='0' selected>请选择关系</option>"
				for(var j=0;j<res.length;j++){
					option+="<option value='"+res[j].betweenId+"'>"+res[j].between+"</option>"
				}
				$("select[name='betweenId']").append(option);
			}
		})
		
		$("#find").click(function(){
			var betweenId=new Array();
			$("select[name='betweenId']").each(function(){
				betweenId.push($(this).val());
			});
			var citizenship=new Array();
			$("input[name='citizenship']").each(function(){
				citizenship.push($(this).val());
			});
			var name=new Array();
			$("input[name='name']").each(function(){
				name.push($(this).val());
			});
			var gender=new Array();
			$("select[name='gender']").each(function(){
				gender.push($(this).val());
			})
			var birth=new Array();
			$("input[name='birth']").each(function(){
				birth.push($(this).val());
			});
			var certificate=new Array();
			$("select[name='certificate']").each(function(){
				certificate.push($(this).val());
			})
			var thisCity=new Array();
			$("select[name='thisCity']").each(function(){
				thisCity.push($(this).val());
			})
			
			$.ajax({
				url:"personalInformation/findFamily",
				data:{betweenId:betweenId,citizenship:citizenship,name:name,gender:gender,birth:birth,certificate:certificate,thisCity:thisCity},
				type:"POST",
				traditional: true,
				success:function(data){ 
					console.log("添加成功！！");
					//跳转到计生信息
	                window.location.href="marriage.html"; 
				},
				error:function(){
					window.location.href="404.html";
				}
			})
		})
})